﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


        /*定义一个图书类，存放图书的编号、书名、价格、出版社、作者信息；
         对价格进行赋值限制，小于0价格，赋值为0
         在图书类中定义一个方法输出图书信息；*/


namespace ConsoleApp1
{
    class Books
    {
        public int ID { get; set; }
        public string Name { get; set; }

        public double Price
        {
            get => this.Price;
            set
            {
                if (value < 0)
                {
                    this.Price = 0;
                }
                else
                {
                    this.Price = value;
                }
            }
        }
        public string outBanShe { get; set; }
        public string writer { get; set; }

        public Books(int iD, string name, double price, string outBanShe, string writer)
        {
            ID = iD;
            Name = name;
            Price = price;
            this.outBanShe = outBanShe;
            this.writer = writer;
        }

        public Books()
        {
        }
    }
}
